package com.ms.demo.demo2;

/**
 * @description: 创建非终结表达式实现类MinusOperation相减操作
 * @author: ms
 * @create: 2022-10-28 11:32
 */
public class MinusOperation  extends NonTerminalExpression {

    public MinusOperation(Expression e1, Expression e2) {
        super(e1, e2);
    }

    //将两个表达式相减
    @Override
    public int interpret(Context context) {
        return this.e1.interpret(context) - this.e2.interpret(context);
    }
}